<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        function Parent1() {
            this.name = 'parent1';
            this.color = ['red', 'green', 'blue']
        }
        Parent1.prototype.say = function () {
            console.log('kobe haha');
        };

        function Child1() {
            Parent1.call(this);
            this.type = 'child1';
        }
        var child1 = new Child1()
        child1.color.push('black')
        var child2 = new Child1()
        console.dir(Child1);

        console.log(child1 instanceof Child1) ; // true
        console.log(child1 instanceof Parent1) ; // false
        
        console.log(child1.color); // ["red", "green", "blue", "black"]
        console.log(child2.color); // ["red", "green", "blue"]
    </script>
</body>

</html>